package com.qf.task;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.util.Date;

/**
 * 定时器
 * @author lixu
 */
@Component
public class SchedulingTask {

    @Value("${server.port}")
    private String serverPort;
    /**
     * 定时器
     */
    @Scheduled(cron = "* * * * * ?")
    public void task1(){
        System.out.println("我是task1:取消订单：时间:" + new Date() + ":端口号:" + serverPort);
    }
}
